<!DOCTYPE html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <title>会议室预约</title>
    <meta name="description" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
    <meta http-equiv="cleartype" content="on">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/assets/meeting/css/style.css">
    <link rel="stylesheet" href="/assets/public/layermobile/css/layer.css">
</head>
<body>
<div class="wraper" js="wapjs/meeting/js/index">
    <div class="head clearfix">
        <a href="javascript:history.back();" class="iconfont icon-zuo"></a>
        <span class="head-name">选择审核人员</span>
    </div>
   <!-- <div class="search">
        <p class="tips-text text-gray text-center"><span class='iconfont icon-sousuo'></span>搜索名字、拼音、手机号</p>
        <input class="search-input" value=""/>
    </div>-->
    <div class="lists notopblock">
        <div class="fullbox">
            <div class="level-box">
                <a href="#" class="level" id="level-1">{BEESCRM:$accountInfo['account_name']}</a>
                <foreach name="departmentPath" key="k" item="vo">
                    <a href="#" class="level" id="level-{BEESCRM:$k+2}"><span class="iconfont icon-you" ></span> {BEESCRM:$vo.department_name}</a>
                </foreach>
            </div>
        </div>
    </div>

    <div class="lists">
        <foreach name="data" item="vo">
            <div class="list-line tb-mode">
                <div class="tb-cell check-box" data-id="{BEESCRM:$vo.user_id}"><span class="iconfont icon-xuanze" ></span></div>
                <div class="tb-cell small-photo">
                    <if condition="$vo.avatar">
                        <img src="{BEESCRM:$vo.avatar}"/>
                        <else />
                        <img src="/assets/meeting/images/photo.jpg"/>
                    </if>
                </div>
                <div class="tb-cell">{BEESCRM:$vo.real_name}</div>
            </div>
        </foreach>
    </div>
    <div class="fixed-total">
        <div class="tb-mode">
            <div class="tb-cell"><a href="javascript:void(0)" class="btn pull-right bg-green sure" data-account_id="{BEESCRM:$accountId}">确定</a></div>
        </div>
    </div>
</div>

<input type="hidden" name="user_id" id="user_id" value="" />
<input type="hidden" name="basicId" id="basicId" value="{BEESCRM:$basicId}" />
<input type="hidden" name="level" id="level" value="{BEESCRM:$level}" />
<script type="text/javascript" src="/assets/public/seajs/sea.js"></script>
<script enter="publicjs/public" id="confnode" async="async" src="/assets/public/config.js"></script>
<script type="text/javascript" src="/assets/public/jquery-2.1.0.min.js"></script>
<script>
    $('.check-box').click(function () { //设定是否需要多级审核
        if ($(this).find('.iconfont').hasClass('icon-xuanze1')) {
            $(this).find('.iconfont').addClass('icon-xuanze');
            $(this).find('.iconfont').removeClass('icon-xuanze1');
            $("#user_id").val('');
        } else {
            $('.check-box').each(function() {
                $(this).find('.iconfont').removeClass('icon-xuanze1');
                $(this).find('.iconfont').addClass('icon-xuanze');
            });
            $(this).find('.iconfont').addClass('icon-xuanze1');
            console.log($(this).data('id'));
            $("#user_id").val($(this).data('id'));
        }
    })

    $(document).on('click','.sure',function() { //选择审核人员、确定
        var account_id = $(this).data('account_id');
        var data = {};
        data.user_id = $("#user_id").val();
        data.basicId = $("#basicId").val();
        data.level = $("#level").val();
        //console.log(data);return;
        if(!data.user_id) {
            fm.alert('请选择审核人员~');return false;
        }
        console.log(account_id);
        var s = "/meeting/meetingAppoint/appointAudited/multilevel/1/account_id/" + account_id + "/user_id/"+data.user_id+"/basic_id/"+data.basicId+"/level/"+data.level;
        console.log(s);
        window.location.href = s;
    });

</script>
</body>
</html>